<?php

/*
author: d3m
Returns an array of the corresponding attributes
*/

function BL_getAttributes($ids)
{
    $i = 0;
    //print_r($ids);

    foreach ($ids as $id)
    {
        $entity = DB_getEntity($id);
        $attributes[$i] = $entity->GetAttributes();
        $i++;
    }

    return $attributes;
}

/*
author: basanas
Gets an Entity object by id
*/

function BL_getEntity($id)
{
    return DB_getEntity($id);
}

/*
author: basanas
Gets an array of Entity objects by their ids (as an array)
*/

function BL_getEntities($ids)
{
    $i = 0;

    foreach ($ids as $id)
    {
        $entities[$i] = DB_getEntity($id);
        $i++;
    }

    return $entities;
}

function BL_getEntitiesfromCategory($catId){

	$category = DB_getCategory($catId);

	$all_entities = DB_getEntities($category);

	$ids = array();

	foreach($all_entities as $ent){
		$temp_array = array();
		$temp_array[] = $ent->GetId();
		$temp_array[] = $ent->GetName();
		
		$ids[] = $temp_array;
	}

	return $ids;
	
	
}




?>
